package com.andyage.admin.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Service;

import com.andyage.admin.dao.AdcommentMapper;
import com.andyage.admin.service.IAdcommentService;
import com.andyage.util.JsonContent;
import com.andyage.admin.bean.AdcommentBean;
@Service
public class AdcommentServiceImpl implements IAdcommentService {
	@Resource
	private AdcommentMapper adcommentMapper;
	@Override
	public String queryAdcommentInfo(AdcommentBean adcomment)throws Exception {
		List<AdcommentBean> list= adcommentMapper.queryAdcommentInfo(adcomment);
		int total=adcommentMapper.queryAdcommentInfoCount(adcomment);
		String json=JsonContent.getJsonArray(list, total);
		return json;
	}

	@Override
	public int deleteAdcommentInfo(String commentId)throws Exception {
		int flag=adcommentMapper.deleteAdcommentInfo(commentId);
		return flag;
	}

	@Override
	public int updateAdcommentInfo(AdcommentBean adcomment) throws Exception {
		adcomment.setCommentAnswerTime(new Date());
		int falg=adcommentMapper.updateAdcommentInfo(adcomment);
		return falg;
	}

}
